/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       creature.h

	$Header: /game/creature_stack.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef CREATURE_H_INCLUDED
#define CREATURE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "creature_stack.h"

enum   t_creature_ability;
struct t_creature_traits;
enum   t_creature_type;
// -----------------------------------------------------------------------
// stack of creatures
// -----------------------------------------------------------------------
class t_creature : public t_stack_with_backpack
{
public:
	typedef t_creature_stack_ptr t_clone_ptr;

	t_creature();
	t_creature( t_creature_type creature, int amount );
	void                        add( t_creature const& arg );
	virtual bool                can_add( t_creature_type creature ) const;
	virtual bool				can_add( t_creature_stack const& arg ) const;
	virtual t_clone_ptr			clone() const;
	virtual int					compute_scouting_range() const;
	virtual t_town_type         get_alignment() const;
	virtual t_skill_mastery		get_anti_stealth_level() const;
	virtual std::string			get_army_name() const;
	virtual t_model_ptr			get_combat_model( double scale ) const;
	virtual int					get_combat_movement() const;
	virtual t_creature const*	get_const_creature() const;
	virtual t_creature_type     get_creature_type() const;
	virtual int					get_damage_high() const;
	virtual int					get_damage_low() const;
	virtual float				get_defense( bool ranged, t_creature_array const& army ) const;
	virtual float				get_defense_basic( bool ranged ) const;
	virtual float				get_defense_bonus( bool ranged ) const;
	virtual	float				get_defense_reduction( bool ranged ) const;
	virtual int                 get_experience_value( int number = -1 ) const;
	virtual int					get_hit_points() const;
    virtual void				get_income( int day, t_material_array& income ) const;
	virtual int					get_magic_resistance( t_player const* owner, t_spell spell ) const;
	virtual int			        get_maximum_spell_points() const;
	virtual t_missile_type      get_missile_type() const;
	virtual int                 get_morale( t_creature_array const& army ) const;
	virtual int					get_move_cost( t_terrain_type terrain ) const;
	virtual std::string			get_name( bool include_article = false, int number = -1 ) const;
	virtual int					get_number() const;
	virtual float				get_offense( bool ranged ) const;
	virtual float				get_offense( bool range, t_creature_array const& army ) const;
	virtual t_bitmap_layer_ptr	get_portrait( int height = 52, bool force_awake_portrait = false ) const;
	virtual std::string			get_right_click_text() const;
	virtual int					get_shots() const;
	virtual int					get_speed() const;
	virtual int					get_speed( t_creature_array const& army ) const;
	virtual int					get_spell_points() const;
	virtual int                 get_spell_power( t_spell spell, t_abstract_grail_data_source const & grail_data, int number = -1 ) const;
	virtual t_skill_mastery		get_stealth_level() const;
	virtual int					get_stoning_chance() const;
	t_creature_traits const&    get_traits() const;
	virtual bool                has_ability( t_creature_ability ability ) const;
	virtual bool                knows_spell( t_spell spell ) const;
	virtual bool				is_active() const;
	virtual	bool				is_native_terrain( t_terrain_type terrain ) const;
	virtual bool				is_undead() const;
	virtual bool                preplacement( t_adventure_map& map, int pass, t_player* owner );
	virtual void				process_new_day( t_player* owner, bool grow,
												 t_creature_array* army, int day );
	virtual bool                read( std::streambuf& stream );
	virtual bool                read_from_map( std::streambuf& stream );
	virtual void                remove( int amount );
	virtual bool                write( std::streambuf& stream ) const;
protected:
	virtual int	get_luck_bonus( t_hero const& hero ) const;
	virtual int get_morale_bonus( t_hero const& hero ) const;

	t_creature_type m_creature;
	int             m_number;
	int				m_growth; // fractional growth for neutral creatures
};

inline t_creature_type	t_creature::get_creature_type() const
{
	return m_creature;
}

typedef t_counted_ptr<t_creature> t_creature_ptr;


#endif // CREATURE_H_INCLUDED